﻿using Project_veilingsite.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Project_veilingsite.Controllers
{
    public class AboutController : Controller
    {
        //
        // GET: /About/
        [HttpGet]
        public ActionResult Index()
        {
            var model = new AboutModel();
            try
            {

                model.SubTitleSite = "Over de website";
                model.SubTitleMembers = "Groepsleden";
            }
            catch (Exception e)
            {
                //Server.MapPath("~") = de root-map van het project
                string pad = Server.MapPath("~") + "/LoggingTracing/tracingLogging.txt";
                if (!System.IO.File.Exists(pad))
                {
                    System.IO.File.Create(pad);
                }

                using (StreamWriter swTracing = System.IO.File.AppendText(pad))
                {
                    swTracing.Write("\n\nDatum/Tijd: " + DateTime.Now + "\nException: " + e.StackTrace);
                }
            }
            return View(model);
        }
    }
}